package org.example;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
//        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//        OrderDao orderDao = (OrderDao) ctx.getBean("orderDao");
//        orderDao.save();
//        UserDaoFactory userDaoFactory = new UserDaoFactory();
//        UserDao userDao = userDaoFactory.getUserDao();
//        userDao.save();
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserDao userDao = (UserDao) ctx.getBean("userDao");
        UserDao userDao1 = (UserDao) ctx.getBean("userDao");
        System.out.println(userDao);
        System.out.println(userDao1);
    }

}
